@model SealManagement.Models.SignMakerInfo

@{
    ViewData["Title"] = "制章人详情";
}
<h2 style="margin:20px 0">制章人详情</h2>
<hr />

		<script src="~/js/utils.js"></script>
		<script src="~/lib/jquery/jquery-1.12.4.js"></script>
<div class="table-responsive">
    <table class="table table-bordered  table-condensed">
        <thead>
            <tr class="row mx-0" >
                <th class="text-center col-md-1">@Html.DisplayNameFor(model => model.SignMaker.UserName)</th>
                <th class="col-md-2 text-center ">@Html.DisplayNameFor(model => model.SignMaker.ArrayNo)</th>
                <th class="text-center col-md-2">@Html.DisplayNameFor(model => model.Subject)</th>
                <th class="text-center col-md-2">@Html.DisplayNameFor(model => model.Issuer)</th>
                <th class="text-center  col-md-1">@Html.DisplayNameFor(model => model.SignMaker.Certificator)</th>
                <th class="text-center  col-md-1">@Html.DisplayNameFor(model => model.SignMaker.CreateDate)</th>
                <th class="text-center  col-md-1">@Html.DisplayNameFor(model => model.SignMaker.Remark)</th>
                <th class="text-center col-md-1">@Html.DisplayNameFor(model => model.NotBefore)</th>
                <th class="text-center col-md-1">@Html.DisplayNameFor(model => model.NotAfter)</th>
            </tr>
        </thead>
        <tbody>
            <tr class="text-center row  mx-0">
                <td class="col-md-1">
                    @Html.DisplayFor(model => model.SignMaker.UserName)
                </td>
                <td class="col-md-2">
                    @Html.DisplayFor(model => model.SignMaker.ArrayNo)
                </td>
                <td class="col-md-2">
                    @Html.DisplayFor(model => model.Subject)
                </td>
                <td class="col-md-2">
                    @Html.DisplayFor(model => model.Issuer)
                </td>
                <td class="col-md-1">
                    <a id="a" style="cursor: pointer;">点击下载</a>
                    <!-- @Html.ActionLink("点击下载", "DownCert", "SignMaker", new { id = Model.SignMaker.Id }); -->
                </td>
                <td class="col-md-1">
                    @Html.DisplayFor(model => model.SignMaker.CreateDate)
                </td>
                <td class="col-md-1">
                    @Html.DisplayFor(model => model.SignMaker.Remark)
                </td>
                <td class="col-md-1">
                    @Html.DisplayFor(model => model.NotBefore)
                </td>
                <td class="col-md-1">
                    @Html.DisplayFor(model => model.NotAfter)
                </td>
            </tr>
        </tbody>
    </table>
</div>
<script type="text/javascript">
	$(function(){
		$("#a").click(()=>{
			down(@Model.SignMaker.Id);
		})
	})
	function down(id) {
		let base64 = new Base64();
		EncryptCertList((data) => {
			data = JSON.parse(data);
			
let CertID = getCookie("CertID");
			//加密的字符串
			var str = JSON.stringify({
				Id: id
			});
			var External = {
				CertID: CertID,
				//编码
				DataBase64: base64.encode(str)
			};
	
			ExternalEncrypt(JSON.stringify(External), (data) => {
				data = JSON.parse(data);
				if (data.error == "Ok") {
					var d = data.contentBase64;
					var reg = new RegExp('\\+', "g")
					var dd = d.replace(reg, '%2B');
					location.href = "/SignMaker/DownCert?EncryptData=" + dd;
					
				} else {
                                layer.msg(data.error)
                            }
			});
		})
	}
</script>
<div>
    @*<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a>*@ 
    <a asp-action="Index">跳回列表页面</a>
</div>
